package com.mpgame;

import com.mpgame.core.battle.BattleEngine;
import com.mpgame.core.loader.SkillLoader;
import com.mpgame.core.model.Monster;
import com.mpgame.core.model.Skill;
import com.mpgame.core.model.SkillType;
import com.mpgame.core.utils.FileHelper;

public class App 
{
    public static void main( String[] args )
    {
        String testJson = FileHelper.getFileContent("mp-gamecore/skills/testskill1.json");
        Skill s1 = SkillLoader.loadSkill(0, 120, 0, 5, 1.0, SkillType.MELEE, testJson);
        s1.setIdentifier("【炎拳】");

        Monster m1 = new Monster(45, 0, 123, 234, 200, 100, 200, 4000, s1, s1, s1, s1);
        Monster m2 = new Monster(72, 0, 500, 234, 321, 280, 231, 4222, s1, s1, s1, s1);

        int count = 0;
        BattleEngine engine = new BattleEngine(m1, m2);
        while(!engine.getIsBattleEnded()){
            engine.doRound(-1, -1);

            if(++count > 100){
                System.out.println("死循环，已自动停止");
                break;
            }
        }
    }
}
